<?php

namespace Database\Seeders;

use App\Models\Config;
use App\Models\ConfigItem;
use Illuminate\Database\Seeder;

class ConfigSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $configs = [
            ['name' => '网站信息', 'code' => 'Website Information', 'sort' => 1],
            ['name' => '备案信息', 'code' => 'Filing information', 'sort' => 2],
        ];
        foreach ($configs as $config) {
            Config::factory()->create($config);
        }

        $configItems = [
            ['config_id' => '1', 'name' => '网站名称', 'content' => '我的博客', 'type' => 'string', 'sort' => 1],
            ['config_id' => '1', 'name' => '网站Logo', 'content' => 'logo.jpg', 'type' => 'image', 'sort' => 2],
            ['config_id' => '2', 'name' => 'ICP备案编号', 'content' => '京ICP备19004658号', 'type' => 'string', 'sort' => 1],
            ['config_id' => '2', 'name' => '公安备案文字', 'content' => '公安备案号11010502030143', 'type' => 'string', 'sort' => 2],
        ];
        foreach ($configItems as $configItem) {
            ConfigItem::factory()->create($configItem);
        }
    }
}
